home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 2010 April
/
PCWorld0410.iso
/
pluginy Firefox
/
8206
/
8206.xpi
/
content
/
rss
/
joint.js
< prev
next >
Wrap
Text File
|
2010-02-02
|
704b
|
31 lines
WiseStampJoint.prototype = new Object();
WiseStampJoint.prototype.call = WiseStampJoint_call;
function WiseStampJoint(expectedCalls, callback) {
this._expectedCalls = expectedCalls;
this._results = []
this._calls = [];
for (var i=0; i<expectedCalls; i++) {
this._calls[i] = false;
this._results[i] = false;
};
this._callback = callback;
if (expectedCalls <= 0) {
this._callback.apply(null, this._results);
};
}
function WiseStampJoint_call(index, value) {
if (!this._calls[index]) {
this._expectedCalls --;
this._calls[index] = true;
this._results[index] = value;
};
if (this._expectedCalls <= 0) {
this._callback.apply(null, this._results);
};
}